package com.hxtec.polaris.service;

import com.hxtec.polaris.commons.dto.OrderInfoDto;
import com.hxtec.polaris.entity.ShopAddress;
import com.hxtec.polaris.entity.ShopOrder;

import java.util.Map;
import java.util.Optional;

/**
 * @Author yonyong
 * @Description //订单相关service
 * @Date 2019/12/3 14:49
 * @Param
 * @return
 **/
public interface OrderService {

    /**
     * 根据条件获取订单
     * state 0 全部订单 1 待付款订单 2待收货订单 3待评价订单 4 售后订单
     * @return
     */
    Object getOrder(Integer state, Integer pageNow, Integer rows);

    /**
     * 提交订单
     * @param orderInfoDto
     * @return
     */
    Map<String, Object> submitOrder(OrderInfoDto orderInfoDto);

    Optional<ShopOrder> getOne(String orderId);

    /**
     * 根据订单号获取订单价格及除了商品其它所有的相关的信息
     * @param oid
     * @return
     */
    Object getPrice(int oid);

    /**
     * 延时收货
     * @param shopOrder
     * @return
     */
    Object extendedReceipt(ShopOrder shopOrder);

    /**
     * 确认收货
     * @param shopOrder
     * @return
     */
    Object confirmReceipt(ShopOrder shopOrder);

    /**
     * 删除订单
     * @param shopOrder
     * @return
     */
    Object deleteOrder(ShopOrder shopOrder);

    /**
     * 取消订单
     * @param shopOrder
     * @return
     */
    Object cancelOrder(ShopOrder shopOrder);

    /**
     * 评价订单
     * @param id
     * @param state
     * @param content
     * @return
     */
    Object rateOrder(int id,int state, String content);
}
